<template>
  <div class="conatiner">
    <jyjg
      v-if="showMode == 'list'"
      v-on:switchDetail="switchToDetail"
    ></jyjg>
    <detail
      v-if="showMode == 'detail'"
      v-on:switchList="switchToList"
    ></detail>
  </div>
</template>
<script>
  import jyjg from "./list";
  import detail from "./detail";
  export default {
    data() {
      return {
        showMode: "list", // 默认显示List界面
      };
    },
    created() {},
    methods: {
      // 在List界面点击xxx份
      switchToDetail() {
        this.showMode = "detail";
      },
      // 在detail界面点击返回上一级，回到List界面
      switchToList() {
        this.showMode = "list";
      },
    },
    components: {
      jyjg,
      detail,
    },
  };
</script>
<style lang="less" scoped>
</style>
